# 2024/1/10 18:47 HFL

import unittest
from HTMLTestRunner import HTMLTestRunner

from common import changefilename
from common.changefilename import fname

# 新建一个用例池
suite = unittest.TestSuite()
# 生成一个加载方法
loader = unittest.TestLoader()
# 通过测试用例名称加载测试用例
# suite.addTest(loader.loadTestsFromTestCase(TestLogin))
# suite.addTest(loader.loadTestsFromTestCase(TestBtpshop))
# suite.addTest(loader.loadTestsFromTestCase(Test_Ds_login))
# suite.addTest(loader.loadTestsFromTestCase(TestDsMallRegister3))
fnam =fname('.html')
fpath = '../report/'+fnam

# 运行测试用例并生成报告HTML
with open(fpath,'wb+') as file:

    runner = HTMLTestRunner(stream=file, verbosity=1, title='自动化测试报告', description='会员新增测试模块')
    # 运行搜集的用例池
    runner.run(suite)